import { Server } from "@colyseus/core";
import { WebSocketTransport } from "@colyseus/ws-transport";
import { createServer } from "http";
import { GameRoom } from "./game-room";
import express from "express";

const app = express();

const gameServer = new Server({
  transport: new WebSocketTransport({
    server: createServer(app)
  })
});

gameServer.define("game", GameRoom);
gameServer.listen(3002,'localhost',0,()=>{
  console.log(`Listening on ws://localhost:3002`);
});

app.get('/', (req, res) => {
  console.log('started')
})